pull: complete detached meta fetch before scanning
authorJonathan Lebon <jlebon@redhat.com>
Wed, 17 May 2017 15:41:54 +0000 (11:41 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 18 May 2017 01:14:15 +0000 (01:14 +0000)
commita8fd37b6a08540d93c99d099a32ff5c3f89a99ec
tree08ffe9b4a9be883580d570710317283e4cd47911
parent88792f0f22a2560374d6e7e8f37e1f670f335b3f
pull: complete detached meta fetch before scanning

If somehow a repo has gpg verification on but doesn't have signatures
present for the existing commit, ostree would error out if it needs to
scan the commit object (e.g. if there are no updates available).

An instance of this is currently happening in Fedora AH, in which
signatures are not shipped in the ISO due to filesystem restrictions.
Another possible scenario is if a content provider switches from not
signing commits to signing them; even if older commits are retroactively
signed, clients' local commit objects would error out if they needed
scanning.

This patch adds a check to ensure that we always attempt to fetch the
detached metadata and wait for its result (whether it exists or not)
before moving on to scan their corresponding commit objects.

See also: https://github.com/projectatomic/rpm-ostree/issues/630

Closes: #873
Approved by: cgwalters
src/libostree/ostree-repo-pull.c
tests/pull-test.sh
tests/test-remote-headers.sh